﻿@using GoodMan.Infrastructure.Entities.Entity;
@using GoodMan.Infrastructure.Entities.Enum;
@using GoodMan.Portal.Biz;
@if (HttpContext.Current.User.Identity.IsAuthenticated)
{
    var user = new User().Find(HttpContext.Current.User.Identity.Name);
    <span>
        @switch (user.SystemRole)
        {
            default:
            case UserRole.Member:
            <a href="/usercenter/index">您好,@user.RealName 欢迎光临</a>
                                      break;
            case UserRole.Admin:
            <a href="/workspace/admin/index">您好,@user.RealName 欢迎光临</a>
                                           break;
            case UserRole.CollegeAdmin:
            <a href="/workspace/collegeadmin/index">您好,@user.RealName 欢迎光临</a>
                                                  break;
            case UserRole.FinancialOfficer:
            <a href="/workspace/financialofficer/index">您好,@user.RealName 欢迎光临</a>
                                                      break;
            case UserRole.Officer:
            <a href="/workspace/officer/index">您好,@user.RealName 欢迎光临</a>
                                             break;
            case UserRole.Staff:
            <a href="/workspace/Staff/index">您好,@user.RealName 欢迎光临</a>
            if(SupportBiz.IsOnDuty(user.UserName) != -999)
            {
                <div class="btn-group">
                    <button id="btnstate" data-toggle="dropdown" class="btn btn-success btn-mini dropdown-toggle">
                        在线 <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li style="text-align:left;"><a href="javascript:;" onclick="setonline(this)">在线</a></li>
                        <li style="text-align:left;"><a href="javascript:;" onclick="setleave(this)">暂离</a></li>
                        <li style="text-align:left;"><a href="/account/logout">注销</a></li>
                    </ul>
                </div>      
            }       
            break;
        }
        &nbsp;[<a href="/account/logout">注销</a>]&nbsp;&nbsp;&nbsp; </span>
}
else
{
    <span>欢迎光临 &nbsp;&nbsp;[<a href="/account/login">登录</a>]</span> 
    <span>[<a href="/account/register">注册</a>]&nbsp;&nbsp;&nbsp;&nbsp;</span>
}